package com.sharer.last.wrapper;

import com.sharer.last.base.support.BaseEntityWrapper;
import com.sharer.last.model.po.CategoryPO;
import com.sharer.last.model.vo.category.CategoryVO;
import com.sharer.last.utils.BeanUtil;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 分类转换器
 *
 * @ClassName CategoryWrapper
 * @Author WangJin
 * @Date 2023/05/20/17:22
 * @Description
 * @Version 1.0
 */
@Component
@AllArgsConstructor
public class CategoryWrapper extends BaseEntityWrapper<CategoryPO, CategoryVO> {
    /**
     * 单个实体类包装
     *
     * @param entity
     * @return
     */
    @Override
    public CategoryVO entityVO(CategoryPO entity) {
        CategoryVO vo = BeanUtil.copy(entity, CategoryVO.class);
        return vo;
    }
}
